package com.sxpro;

public class Thoroughbred {
    // 属性
    private Thoroughbred mother; // 母亲
    private Thoroughbred father; // 父亲
    private int birthYear; // 出生年份

    // 构造方法
    public Thoroughbred(Thoroughbred mother, Thoroughbred father, int birthYear) {
        this.mother = mother;
        this.father = father;
        this.birthYear = birthYear;
    }

    // 获取当前年龄
    public int getCurrentAge() {
        int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR);
        return currentYear - birthYear;
    }

    // 获取父亲
    public Thoroughbred getFather() {
        return father;
    }

    // 获取母亲
    public Thoroughbred getMother() {
        return mother;
    }
}

